//
//  FSUIMarco.h
//  FSiOSClient
//
//  Created by purlible on 2024/8/22.
//

#ifndef FSUIMarco_h
#define FSUIMarco_h

#ifdef DEBUG
static const int ddLogLevel = DDLogLevelVerbose;
#else
static const int ddLogLevel = DDLogLevelError;
#endif

#define FSWeakSelf __weak typeof(self) weakSelf = self;

#define isNull(key) (key == nil  || [key isEqual:[NSNull null]] || (NSNull*)key == [NSNull null] )

/// 类型相关
#define IS_IPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

/// 屏幕尺寸相关
#define SCREEN_WIDTH  ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)

#define RGBA(r, g, b, a) [UIColor colorWithRed:r / 255.0 green:g / 255.0 blue:b / 255.0 alpha:a]

#define UserDefaults                        [NSUserDefaults standardUserDefaults]

/// 手机类型相关
#define IS_IPHONE_4_OR_LESS  (IS_IPHONE && SCREEN_HEIGHT  < 568.0)

#define IS_IPHONE_SE4          ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)
#define IS_IPHONE_8_OR_SE47       ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)
#define IS_IPHONE_8P         ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1080, 1920), [[UIScreen mainScreen] currentMode].size) && !IS_IPAD : NO)

#define IS_IPHONE_X_series  (!(IS_IPHONE_4_OR_LESS || IS_IPHONE_SE4 || IS_IPHONE_8_OR_SE47 || IS_IPHONE_8P))

/// 导航条高度
#define APPLICATION_TOP_BAR_HEIGHT (IS_IPHONE_X_series?88.0f:64.0f)
/// tabBar高度
#define APPLICATION_TAB_BAR_HEIGHT (IS_IPHONE_X_series?83.0f:49.0f)
/// 状态栏高度
#define APPLICATION_STATUS_BAR_HEIGHT (IS_IPHONE_X_series?44:20.0f)

// tabbar高度 差值
#define APPLICATION_STATUS_INDICATOR_HEIGHT (IS_IPHONE_X_series ? 34.f : 0.f)
// X和其他机型状态栏高度差
#define APPLICATION_STATUS_HEIGHT_DIFF (IS_IPHONE_X_series ? 24.f : 0.f)
// X 键盘高度差
#define APPLICATION_KEYBOARD_HEIGH_DIFF (IS_IPHONE_X_series ? 75.f : 0.f)

#define FSUIViewAnimationOptionsCurveOut (7<<16)

//是否是gif图片
#define FSISGIFTypeWithData(data)\
({\
BOOL result = NO;\
if(!data) result = NO;\
uint8_t c;\
[data getBytes:&c length:1];\
if(c == 0x47) result = YES;\
(result);\
})


//短信倒计时
#define SmsCountdown 60

//********** APP2.0 色号和字号 ***********//

#define COLOR_VIEW_BG UIColorHex(#F6F8FC)
#define COLOR_3F3E3E UIColorHex(#3F3E3E)
#define COLOR_0C0C0C UIColorHex(#0C0C0C)

#define COLOR_333333 UIColorHex(#333333)
#define COLOR_EB3349 UIColorHex(#EB3349)
#define COLOR_BDBDBD UIColorHex(#BDBDBD)
#define COLOR_999999 UIColorHex(#999999)
#define COLOR_E4E4E4 UIColorHex(#E4E4E4)
#define COLOR_6DA5FF UIColorHex(#6DA5FF)
#define COLOR_F5F5F5 UIColorHex(#F5F5F5)


#define FONT_SIZE_11 [UIFont scale_systemFontOfSize:11]
#define FONT_SIZE_12 [UIFont scale_systemFontOfSize:12]
#define FONT_SIZE_13 [UIFont scale_systemFontOfSize:13]
#define FONT_SIZE_14 [UIFont scale_systemFontOfSize:14]
#define FONT_SIZE_15 [UIFont scale_systemFontOfSize:15]
#define FONT_SIZE_16 [UIFont scale_systemFontOfSize:16]
#define FONT_SIZE_17 [UIFont scale_systemFontOfSize:17]
#define FONT_SIZE_18 [UIFont scale_systemFontOfSize:18]
#define FONT_SIZE_19 [UIFont scale_systemFontOfSize:19]
#define FONT_SIZE_20 [UIFont scale_systemFontOfSize:20]
#define FONT_SIZE_24 [UIFont scale_systemFontOfSize:24]
#define FONT_SIZE_26 [UIFont scale_systemFontOfSize:26]


#define FONT_SIZE_X11  [UIFont scale_boldSystemFontOfSize:11]
#define FONT_SIZE_X12  [UIFont scale_boldSystemFontOfSize:12]
#define FONT_SIZE_X14  [UIFont scale_boldSystemFontOfSize:14]
#define FONT_SIZE_X15  [UIFont scale_boldSystemFontOfSize:15]
#define FONT_SIZE_X16  [UIFont scale_boldSystemFontOfSize:16]
#define FONT_SIZE_X17  [UIFont scale_boldSystemFontOfSize:17]
#define FONT_SIZE_X18  [UIFont scale_boldSystemFontOfSize:18]
#define FONT_SIZE_X19  [UIFont scale_boldSystemFontOfSize:19]
#define FONT_SIZE_X21  [UIFont scale_boldSystemFontOfSize:21]
#define FONT_SIZE_X22  [UIFont scale_boldSystemFontOfSize:22]
#define FONT_SIZE_X24  [UIFont scale_boldSystemFontOfSize:24]
#define FONT_SIZE_X26  [UIFont scale_boldSystemFontOfSize:26]

#define kHCBootPrivacyAgreed @"kHCBootPrivacyAgreed"

#define kHCPrivacyAgreementUrl @""
#define kHCUserAgreementUrl @""


#define kCharacteristicOldUUID @"FFE1"
#define kCharacteristicNewUUID @"FFF1"




#endif /* FSUIMarco_h */
